<template lang="html">
            <!--  -->
        <div class="handle-box">
            <el-form ref="form"  >
                <el-form-item  v-for="item in subList.search" :label="item.label">
                    <el-col :span="12" v-if="!item.type">
                        <el-input :placeholder="item.placeholder" v-model="item.value"  class="handle-input mr10"></el-input>
                    </el-col>
                    <el-col :span="12" v-if="item.type=='select'">
                        <el-select v-model="item.value"  >
                            <el-option v-for="sunitem in item.options" :key="sunitem.value" :label="sunitem.text" :value="sunitem.value"></el-option>
                        </el-select>
                    </el-col>
                    <el-col :span="12" v-if="item.type=='dateTime'" >
                        <el-date-picker
                                v-model="item.value"
                                :picker-options="item.begintime"
                                type="date"
                                :value-format="item.cfg.format"
                                style="width: 175px;"
                                :placeholder='item.placeholder'
                        ></el-date-picker>
                    </el-col>
                </el-form-item>             
            </el-form > 
   
				<!-- 搜索按钮 -->
            <el-button type="primary" icon="el-icon-search" @click="handleSearch">搜索</el-button>
                <!-- 添加产品 -->
            
            <slot name="handle">
                
            </slot>
        </div>

</template>
<script>
    import * as apilist from '@/api/api.js';
    export default {
        name:'tabel-cell',
        data() {
            return {
                 name:"张三",
                 begintime:"2019-02-03",
                 subList: {
                            url:'listgoods',
                            reqParams: {
                                appId: null,
                                memberId: null
                            },
                            search: [{
                                label: '成员账户',
                                field: "memberAccount",
                                value: null,
                                placeholder: "请输入..."
                            },
                            {
                                label: '地址',
                                field: "memberAccount",
                                value: null,
                                placeholder: "请输入..."
                            }, {
                                label: '成员姓名',
                                field: "memberName",
                                value: null,
                                placeholder: "请输入..."
                            }, {
                                label: '成员角色',
                                field: "memberRole",
                                value: 0,
                                type: "select",
                                options: [{
                                    text: "全部",
                                    value: 0
                                }, {
                                    text: "用户",
                                    value: 7
                                }, {
                                    text: "商户",
                                    value: 1
                                }, {
                                    text: "大学生",
                                    value: 6
                                }, {
                                    text: "零售商",
                                    value: 4
                                }, {
                                    text: "批发商",
                                    value: 3
                                }, {
                                    text: "代理商",
                                    value: 2
                                }]
                            }, {
                                label: '开始时间',
                                field: "startTime",
                                value: null,
                                type: "dateTime",
                                begintime:"2019-02-02 12:12:12",
                                cfg: {
                                    format: 'yyyy-MM-dd HH:mm:ss'
                                },
                                placeholder: "请选择..."
                            }, {
                                label: '结束时间',
                                field: "endTime",
                                value: null,
                                type: "dateTime",
                                begintime:"",
                                cfg: {
                                    format: 'yyyy-MM-dd HH:mm:ss'
                                },
                                placeholder: "请选择..."
                            }],
                            list: [],
                        },
            };
        },
        methods: {
            handleSearch(){

            }
        },
        mounted() {
            apilist[this.subList.url]({
                pageNum: 1,
                pageSize: 10,
                param: {
                    name:"",
                    categoryId:"",
                    distributorId:""
                }
            }).then(res=>{
                console.log(res)
            })
        }
    };
</script>
<style scoped>
.el-form-item--mini.el-form-item, .el-form-item--small.el-form-item{
    display: inline-block;
    width: 250px;
}
.el-col-12 {
    width: 70%;
}
</style>
